Skip to content

feat: increase fast cal to muD=7 #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 18, 2025
Merged

Conversation

yucongalicechen
Copy link
Collaborator

@yucongalicechen yucongalicechen commented Apr 15, 2025

closes #167

Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.20%. Comparing base (1a263b4) to head (d5738a9).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
- Coverage   99.21%   99.20%   -0.01%     
==========================================
  Files           5        5              
  Lines         254      253       -1     
==========================================
- Hits          252      251       -1     
  Misses          2        2              
Files with missing lines Coverage Δ
tests/test_functions.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see comment. I suggested a different way to handle this.

raise ValueError(
f"mu*D is out of the acceptable range (0.5 to 6) "
f"Input mu*D = {mud} is out of the acceptable range "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this message is a bit harsh.

Is there a reason we don't just print a warning message and default to computing using the brute-force method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited! Please check.


coeffs = np.array([f(mud) for f in INTERPOLATION_FUNCTIONS])
muls = np.polyval(coeffs, MULS)
cve = 1 / muls
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified the codes here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


coeffs = np.array([f(mud) for f in INTERPOLATION_FUNCTIONS])
muls = np.polyval(coeffs, MULS)
cve = 1 / muls
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@sbillinge sbillinge merged commit 103f4dc into diffpy:main Apr 18, 2025
5 checks passed
@yucongalicechen yucongalicechen deleted the fast_cal_7 branch April 18, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: muD fast calculation for values <0.5 and >6
2 participants